<template>
    <view style="box-sizing: border-box;padding: 20px;">
        <view v-for="(item,index) in list" style="width: 100%;border: #eee solid 1px;padding: 10px;border-radius: 8px;margin-bottom: 10px;" class="flex">
            <view style="display: inline-block">
                <view class="f12 flex a-t">
                    <image src="https://yunkeososyunchuc.bc8t.cn/lianaikongjian/static/hx.png" mode="widthFix" style="width: 20px;"></image>
                    爱情兑换券
                </view>
                <view>
                    {{item.love_volume_title}}
                </view>
                <view class="f12">
                    赠送后生效，对方可行使一次爱的特权
                </view>
            </view>
            <view style="text-align: center;border-left: #eee dashed 1px;box-sizing: border-box;margin-left: 6px;padding-left: 6px;" class="f12">
                有效期
                <view>
                    {{item.createtime}}
                </view>
                <button open-type="share" @click="fx(item)" class="botton f12">
                    立即赠送
                </button>
            </view>
        </view>
    </view>
</template>

<script>
    export default {
        data() {
            return {
                list: [],
                id: ''
            }
        },
        onShareAppMessage(res) {
            return {
                title: '送你一张情侣特权卡',
                path: '/pages/niu/niu?volume_id=' + this.id
            };
        },

        onLoad() {
            uni.setNavigationBarColor({
                frontColor: '#000000',
                backgroundColor: '#ffffff'
            });
        },
        onShow() {
            this.my()
        },
        methods: {
            fx(e) {
                this.id = e.id
            },
            async my() {
                let data = {
                    status: "my"
                }
                let res = await this.$u.apis.my(data)
                this.list = res
            }
        }
    }
</script>

<style>
    view, text {
        box-sizing: content-box;
    }

    page {
        background: #fff;
    }
</style>
